<!-- templates/messages.html -->
{% extends "base.html" %}

{% block title %}消息中心 - 校园摄影投票系统{% endblock %}

{% block content %}
<div class="container">
    <h2>消息中心</h2>
    {% if messages %}
    <div class="list-group">
        {% for msg in messages %}
        <div class="list-group-item">
            <div class="d-flex w-100 justify-content-between">
                <h6 class="mb-1">{{ msg.sender.username }}</h6>
                <small>{{ msg.created_at.strftime('%Y-%m-%d %H:%M') }}</small>
            </div>
            <p class="mb-1">{{ msg.content }}</p>
        </div>
        {% endfor %}
    </div>
    {% else %}
    <div class="alert alert-info">暂无新消息</div>
    {% endif %}
</div>
{% endblock %}